<%@ page language="java" import="java.util.*" pageEncoding="utf8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
	<head>
		<title>机器添加</title>
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="this is my page">
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">

		<style>
#thisform {
	font-family: Georgia, serif;
	font-size: 12px;
	color: #999;
}

#thisform label {
	font-family: Verdana, sans-serif;
	font-weight: bold;
	color: #660000;
}

#thisform fieldset {
	border: 1px solid #cc;
	padding: 0 20px;
}

#thisform legend {
	font-family: arial, sans-serif;
	font-weight: bold;
	font-size: 90%;
	color: #666;
	background: #eee;
	border: 1px solid #ccc;
	border-bottom-color: #999;
	border-right-color: #999;
	padding: 4px 8px;
}
</style>
	</head>
	<body>
		<form action="addmachine.do" id="thisform" method="post">
			<fieldset>
				<legend>
					机器添加
				</legend>
				<p>
					<label for="hostName" accesskey="9">
						主机名:
					</label>
					<br />
					<c:if test="${mgrMachine==null}"><input type="text" id="hostName" name="hostName" tabindex="1" value="" /></c:if>
					<c:if test="${mgrMachine!=null}"><input type="text" id="hostName" name="hostName" tabindex="1" value="<c:out value='${mgrMachine.hostName}'/>" /></c:if>
				</p>
				<p>
					<label for="machineRoom" accesskey="9">
						机房:
					</label>
					<br />
					<c:if test="${mgrMachine==null}"><input type="text" id="machineRoom" name="machineRoom" tabindex="2"></c:if>
					<c:if test="${mgrMachine!=null}"><input type="text" id="machineRoom" name="machineRoom" tabindex="2" value="<c:out value='${mgrMachine.machineRoom}'/>"></c:if>
				</p>
				<p>
					<label for="machineLocation" accesskey="9">
						机柜:
					</label>
					<br />
					<c:if test="${mgrMachine==null}"><input type="text" id="machineLocation" name="machineLocation" tabindex="3"></c:if>
					<c:if test="${mgrMachine!=null}"><input type="text" id="machineLocation" name="machineLocation" tabindex="3" value="<c:out value='${mgrMachine.machineLocation}'/>"></c:if>
				</p>
				<p>
					<label for="machineBrand" accesskey="9">
						机器品牌:
					</label>
					<br />
					<c:if test="${mgrMachine==null}"><input type="text" id="machineBrand" name="machineBrand" tabindex="4"></c:if>
					<c:if test="${mgrMachine!=null}"><input type="text" id="machineBrand" name="machineBrand" tabindex="4" value="<c:out value='${mgrMachine.machineBrand}'/>"></c:if>
				</p>
				<p>
					<label for="ip">
						IP:
					</label>
					<br />
					<c:if test="${mgrMachine==null}"><input type="text" id="ip" name="ip" tabindex="5"></c:if>
					<c:if test="${mgrMachine!=null}"><input type="text" id="ip" name="ip" tabindex="5" value="<c:out value='${mgrMachine.ip}'/>"></c:if>
				</p>
				<p>
					<label for="machineRam">
						内存:
					</label>
					<br />
					<c:if test="${mgrMachine==null}"><input type="text" id="machineRam" name="machineRam" tabindex="6"></c:if>
					<c:if test="${mgrMachine!=null}"><input type="text" id="machineRam" name="machineRam" tabindex="6" value="<c:out value='${mgrMachine.machineRam}'/>"></c:if>
				</p>
				<p>
					<label for="discInfo">
						磁盘:
					</label>
					<br />
					<c:if test="${mgrMachine==null}"><input type="text" id="discInfo" name="discInfo" tabindex="7"></c:if>
					<c:if test="${mgrMachine!=null}"><input type="text" id="discInfo" name="discInfo" tabindex="7" value="<c:out value='${mgrMachine.discInfo}'/>"></c:if>
				</p>
				<p>
					<label for="storageStructure">
						存储结构:					
					</label>
					<br />
				    <c:if test="${mgrMachine==null}">
					    <select name="storageStructure" tabindex="4" id="storageStructure">
						  <option value="RAID0">RAID0</option>
						  <option value="RAID1">RAID1</option>
						  <option value="RAID5" selected="selected">RAID5</option>
						  <option value="RAID10">RAID10</option>
						  <option value="RAID50">RAID50</option>
					    </select>
				    </c:if>
				    <c:if test="${mgrMachine!=null}">
					    <select name="storageStructure" tabindex="4" id="storageStructure">
						  <option value="RAID0" <c:if test="${mgrMachine.storageStructure=='RAID0'}">selected="selected"</c:if>>RAID0</option>
						  <option value="RAID1" <c:if test="${mgrMachine.storageStructure=='RAID1'}">selected="selected"</c:if>>RAID1</option>
						  <option value="RAID5" <c:if test="${mgrMachine.storageStructure=='RAID5'}">selected="selected"</c:if>>RAID5</option>
						  <option value="RAID10" <c:if test="${mgrMachine.storageStructure=='RAID10'}">selected="selected"</c:if>>RAID10</option>
						  <option value="RAID50" <c:if test="${mgrMachine.storageStructure=='RAID50'}">selected="selected"</c:if>>RAID50</option>
					    </select>
				    </c:if>
				</p>
				<p>
					<label for="cpuInfo">
						CPU信息:
					</label>
					<br />
					<c:if test="${mgrMachine==null}"><input type="text" id="cpuInfo" name="cpuInfo" tabindex="9"></c:if>
					<c:if test="${mgrMachine!=null}"><input type="text" id="cpuInfo" name="cpuInfo" tabindex="9" value="<c:out value='${mgrMachine.cpuInfo}'/>"></c:if>
				</p>
				<p>
					<label for="mountDiscInfo">
						数据库简要信息:
					</label>
					<br />
					<c:if test="${mgrMachine==null}"><input type="text" id="mountDiscInfo" name="mountDiscInfo" tabindex="10"></c:if>
					<c:if test="${mgrMachine!=null}"><input type="text" id="mountDiscInfo" name="mountDiscInfo" tabindex="10" value="<c:out value='${mgrMachine.mountDiscInfo}'/>"></c:if>
				</p>
				<p>
					<c:if test="${mgrMachine!=null}"><input type="hidden" value="<c:out value='${mgrMachine.id}'/>" tabindex="11" id="id" name="id"/></c:if>
					<input type="submit" value="submit" tabindex="11" />
					<input type="button" value="cancel" tabindex="12"  onclick="window.location.href='redirect.do?method=welcome'"/>
				</p>
			</fieldset>
		</form>
	</body>
</html>
